package com.dddd.blog.blogsp.feign;


import com.dddd.blog.blogcommon.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author 喵星球的大橘
 */
@FeignClient(value = "blogPostService",path = "/post",qualifier = "blogPostService")
@Component
public interface ForPostFeignClient {

    /**
     * 插入一篇文章
     * @param post
     * @return
     */
    @PostMapping("/add/map")
    Result addPostByMap(@RequestBody Map<String,Object> post);


    /**
     * 插入文章Map列表
     * @param posts
     * @return
     */
    @PostMapping("/add/map-list")
    Result addPostByMapList(@RequestParam("posts")List<Map<String,Object>> posts);
}
